<link rel="stylesheet" href="__STATIC__/assets/unpkg/element-ui@2.12.0/lib/theme-chalk/index.css">
<style>
	::-webkit-scrollbar{width:0;}

	::-webkit-scrollbar { display: none; }
	.el-menu{
		border: none;
	}
	
</style>
<div id="sidebar-nav" class="sidebar" style="overflow: auto;">
	<el-menu
	:default-active="activeIndex"
	class="el-menu-vertical-demo"
	@open="handleOpen"
	@close="handleClose"
	@select="handleSelect"
	background-color="#2b333e"
	text-color="#fff">
	{%foreach name='menus' item='vo'%}
	<el-submenu index="{%$vo.menu_id%}">
	  <template slot="title">
		<i class="{%$vo.meta.icon%}"></i>
		<span>{%$vo.meta.title%}</span>
	  </template>
	  <el-menu-item-group>
		{%foreach $vo.children as $child%}
		<a href="{%$child.component|url%}"  target="frame_a" id="{%$child.menu_id%}">
			<el-menu-item index="{%$child.component|url%}">{%$child.meta.title%} <span style="color: red;">{%$child.meta.num%}</span></el-menu-item>
		</a>
		{%/foreach%}
	  </el-menu-item-group>
	</el-submenu>
	{%/foreach%}
  </el-menu>
  <a href="" id="a"  target="frame_a"><span id="sp"></span></a>
</div>

<script src="__STATIC__/assets/unpkg/vue@2.6.10/dist/vue.js"></script>
<script src="__STATIC__/assets/unpkg/element-ui@2.12.0/lib/index.js"></script>
<script src="__STATIC__/assets/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript">
	var vm = new Vue({
		el: '#sidebar-nav',
		data: {
			activeIndex:'1'
		},
		components: {
		},
		created: function(){
		},
		mounted() {
			this.activeIndex = sessionStorage.getItem('keyPath') || '1';
			this.$nextTick(() => {
				// 获取a标签
				var link = document.getElementById('a');
				// 设置属性
				link.href = sessionStorage.getItem('keyPath'); // 设置链接地址


			})
				
			setTimeout(() => {
				if(!sessionStorage.getItem('keyPath'))return
				var link = document.getElementById('a');
				link.click();
			},500)
			
		},
		methods:{
			handleOpen(){},
			handleClose(){},
			handleSelect(keyPath) {
				sessionStorage.setItem('keyPath', keyPath);
			}
			
		}
	});
	
</script>
	

			